package com.vegetable.modules.service.stock;

import com.baomidou.mybatisplus.extension.service.IService;
import com.vegetable.modules.entity.stock.CostWeightChangeSource;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.List;

/**
 * <p>
 * 成本单价变化链路查询服务类
 * </p>
 *
 * @author wangruijie
 * @since 2024-03-21
 */
public interface ICostWeightChangeChainService extends IService<CostWeightChangeSource> {

    /**
     * 根据追踪事务ID查询整条链路上的所有变化记录
     * @param ttid 追踪事务ID
     * @return 按时间顺序排列的变化记录列表
     */
    List<CostWeightChangeSource> queryChainByTtid(String ttid);
    
    /**
     * 根据追踪事务ID查询整条链路的详细信息，包括变化统计
     * @param ttid 追踪事务ID
     * @return 链路详细信息
     */
    ChainDetailVO getChainDetail(String ttid);
    
    /**
     * 链路详细信息VO类
     */
    @ApiModel(value="成本单价变化链路详情", description="成本单价变化链路的详细信息")
    class ChainDetailVO {
        /**
         * 追踪事务ID
         */
        @ApiModelProperty(value = "追踪事务ID")
        private String ttid;
        
        /**
         * 变化记录总数
         */
        @ApiModelProperty(value = "变化记录总数")
        private int totalCount;
        
        /**
         * 涉及的商品数量
         */
        @ApiModelProperty(value = "涉及的商品数量")
        private int commodityCount;
        
        /**
         * 总成本变化金额
         */
        @ApiModelProperty(value = "总成本变化金额")
        private java.math.BigDecimal totalChangeAmount;
        
        /**
         * 变化记录列表
         */
        @ApiModelProperty(value = "变化记录列表")
        private List<CostWeightChangeSource> changes;
        
        /**
         * 首次变化时间
         */
        @ApiModelProperty(value = "首次变化时间")
        private java.util.Date firstChangeTime;
        
        /**
         * 最后变化时间
         */
        @ApiModelProperty(value = "最后变化时间")
        private java.util.Date lastChangeTime;
        
        // getter和setter方法
        public String getTtid() {
            return ttid;
        }
        
        public void setTtid(String ttid) {
            this.ttid = ttid;
        }
        
        public int getTotalCount() {
            return totalCount;
        }
        
        public void setTotalCount(int totalCount) {
            this.totalCount = totalCount;
        }
        
        public int getCommodityCount() {
            return commodityCount;
        }
        
        public void setCommodityCount(int commodityCount) {
            this.commodityCount = commodityCount;
        }
        
        public java.math.BigDecimal getTotalChangeAmount() {
            return totalChangeAmount;
        }
        
        public void setTotalChangeAmount(java.math.BigDecimal totalChangeAmount) {
            this.totalChangeAmount = totalChangeAmount;
        }
        
        public List<CostWeightChangeSource> getChanges() {
            return changes;
        }
        
        public void setChanges(List<CostWeightChangeSource> changes) {
            this.changes = changes;
        }
        
        public java.util.Date getFirstChangeTime() {
            return firstChangeTime;
        }
        
        public void setFirstChangeTime(java.util.Date firstChangeTime) {
            this.firstChangeTime = firstChangeTime;
        }
        
        public java.util.Date getLastChangeTime() {
            return lastChangeTime;
        }
        
        public void setLastChangeTime(java.util.Date lastChangeTime) {
            this.lastChangeTime = lastChangeTime;
        }
    }
}